package com.choosefine.it.basedata.service;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.choosefine.it.basedata.dao.WorkerMapper;
import com.choosefine.it.basedata.model.Worker;
import com.github.pagehelper.PageInfo;

@Service("workerService")
public class WorkerService {

	@Autowired
	WorkerMapper workermapper;
	
	//@Override
	public int deleteByPrimaryKey(Integer id) {
		
		return workermapper.deleteByPrimaryKey(id);
	}

	public Worker findByUserCode(String UserCode) {
		
		return workermapper.findByUserCode(UserCode);
	}

	public int deleteByUserCode(Map<String,Object> UserCode) {
		
		return workermapper.deleteByUserCode(UserCode);
	}

	//@Override
	public Worker findByPrimaryKey(Integer id) {
		
		return workermapper.selectByPrimaryKey(id);
	}

	//@Override
	public List<Worker> selectAll() {
		
		return workermapper.selectAll();
	}

	//@Override
	public int insert(Worker record) {
		
		return workermapper.insert(record);
	}

	//@Override
	public int update(Worker record) {
		
		return workermapper.updateByPrimaryKeySelective(record);
	}

	/*//@Override
	public int insertByMap(Map<String, Object> record) {
		
		return workermapper.insert(record);
	}*/

	//@Override
	public int updateByMap(Map<String, Object> record) {
		
		return workermapper.updateByPrimaryKey(record);
	}

	//@Override
	public PageInfo<Worker> findAllByPage(Map<String, Object> t, Integer pageNo,
			Integer pageSize) {
		
		return null;
	}

}